	
/****** Object:  Stored Procedure BulkOrdersInsert    Script Date: Thursday, February 21, 2008 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spBulkOrdersInsert]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [spBulkOrdersInsert]
GO

	
	

/******************************************************************************
**		File: 
**		Name: spBulkOrdersInsert
**		Desc: 
**
**		Return values:
** 
**		Called by:   
**              
**		Parameters:
**		Input							Output
**     ----------							-----------
**
**		Auth: CodeSmith
**		Date: 2/21/2008 2:16:34 AM
*******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:				Description:
**		--------		--------				-------------------------------------------
**    
*******************************************************************************/
CREATE PROCEDURE spBulkOrdersInsert
	@OrderDate datetime,
	@Type tinyint,
	@ProductCode varchar(10),
	@Description nvarchar(50),
	@Color nvarchar(10),
	@StartDate datetime,
	@TotalQtyOrdered int,
	@TotalQtyCompleted int,
	@TotalQtyInProgressBelow50P int,
	@TotalQtyInProgressAbove50P int,
	@EstimatedDate datetime,
	@StockLastCheckedDate datetime,
	@StockLastCheckedQty int,
	@FOB money,
	@CompletedDate datetime,
	@SupplierCode varchar(3),
	@Owner int,
	@Catalogue nvarchar(9),
	@Page varchar(3),
	@Pack varchar(9),
	@PackQty int,
	@CatalogID int,
	@Target bit,
	@SalesDescription1 nvarchar(40),
	@SalesDescription2 nvarchar(40),
	@StockLocation varchar(3),
	@AvailableInUSA bit,
	@BONo varchar(6),
	@MinOrderQty varchar(30),
	@TallPaletQty varchar(30),
	@IDSSortID int,
	@IsArchived bit,
	@CatPackDesc varchar(9),
	@MUKTHGCatPackQty int,
	@MUKTHGCatPackDesc varchar(9),
	@HomeDelivered15Price money,
	@CurrencyID int,
	@IsShownInLGDCatalog bit,
	@SpecialOfferDisc money,
	@ModifiedDate datetime,
	@BulkOrderID int output
AS

INSERT INTO [BulkOrders] 
(
	[OrderDate],
	[Type],
	[ProductCode],
	[Description],
	[Color],
	[StartDate],
	[TotalQtyOrdered],
	[TotalQtyCompleted],
	[TotalQtyInProgressBelow50P],
	[TotalQtyInProgressAbove50P],
	[EstimatedDate],
	[StockLastCheckedDate],
	[StockLastCheckedQty],
	[FOB],
	[CompletedDate],
	[SupplierCode],
	[Owner],
	[Catalogue],
	[Page],
	[Pack],
	[PackQty],
	[CatalogID],
	[Target],
	[SalesDescription1],
	[SalesDescription2],
	[StockLocation],
	[AvailableInUSA],
	[BONo],
	[MinOrderQty],
	[TallPaletQty],
	[IDSSortID],
	[IsArchived],
	[CatPackDesc],
	[MUKTHGCatPackQty],
	[MUKTHGCatPackDesc],
	[HomeDelivered15Price],
	[CurrencyID],
	[IsShownInLGDCatalog],
	[SpecialOfferDisc],
	[ModifiedDate]
) 
VALUES 
(
	@OrderDate,
	@Type,
	@ProductCode,
	@Description,
	@Color,
	@StartDate,
	@TotalQtyOrdered,
	@TotalQtyCompleted,
	@TotalQtyInProgressBelow50P,
	@TotalQtyInProgressAbove50P,
	@EstimatedDate,
	@StockLastCheckedDate,
	@StockLastCheckedQty,
	@FOB,
	@CompletedDate,
	@SupplierCode,
	@Owner,
	@Catalogue,
	@Page,
	@Pack,
	@PackQty,
	@CatalogID,
	@Target,
	@SalesDescription1,
	@SalesDescription2,
	@StockLocation,
	@AvailableInUSA,
	@BONo,
	@MinOrderQty,
	@TallPaletQty,
	@IDSSortID,
	@IsArchived,
	@CatPackDesc,
	@MUKTHGCatPackQty,
	@MUKTHGCatPackDesc,
	@HomeDelivered15Price,
	@CurrencyID,
	@IsShownInLGDCatalog,
	@SpecialOfferDisc,
	@ModifiedDate
)

SELECT @BulkOrderID = @@IDENTITY

GO
	
